package lab02.test28;

import java.util.InputMismatchException;
import java.util.Scanner;

public class Test28 {
    public static void main(String[] args) {
        Scanner  sc = new Scanner(System.in);
        double pai = 3.14;

        try {
            System.out.println("请输入圆的半径：");
            double r = sc.nextDouble();
            double area = r * r * pai;
            System.out.println("圆的面积为："+area);
        }catch (InputMismatchException e) {
            System.out.println("你输入的数据不合法！");
        }
    }
}
